
package com.hlkj.pay.enums;
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

import lombok.Getter;

/**
 * @author HlpayTeam
 * @date 2024/09/12 15:27
 */
public interface TransferOrderEnums {

    @Getter
    enum TRANSFER_ORDER_STATUS
    {

        // 订单状态，订单状态，1=初始化，2=支付中，3=转账成功，4=订单关闭 5=转账失败，6 退票
        // 订单状态，订单状态，1=初始化，2=支付中，3=支付成功，4=已撤销，5=订单关闭 6=订单关闭中 7=支付失败
        INIT(1, "初始化"), PAYING(2, "支付中"), SUCCESS(3, "支付成功"), CLOSE(4, "订单关闭"), FAIL(5, "支付失败"), REFUND(6, "退票"),

        ;

        /**
         * 错误码
         */
        private Integer code;

        /**
         * 错误提示
         */
        private String msg;

        TRANSFER_ORDER_STATUS(Integer code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        public static TRANSFER_ORDER_STATUS from(Integer key) {
            TRANSFER_ORDER_STATUS[] values = TRANSFER_ORDER_STATUS.values();
            for (TRANSFER_ORDER_STATUS deliveryType : values) {
                if (deliveryType.getCode().equals(key)) {
                    return deliveryType;
                }
            }
            return TRANSFER_ORDER_STATUS.INIT;
        }
    }

    @Getter
    enum TRANSFER_ORDER_ENTRY_TYPE
    {

        // 入账方式，1=支付宝账户，2=微信零钱，3=银行卡，4=渠道内部户
        ALIPAY(1, "支付宝账户"), WECHAT(2, "微信零钱"), BANK(3, "银行卡"), CHANNEL(4, "渠道内部户"),

        ;

        /**
         * 错误码
         */
        private Integer code;

        /**
         * 错误提示
         */
        private String msg;

        TRANSFER_ORDER_ENTRY_TYPE(Integer code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        public static TRANSFER_ORDER_ENTRY_TYPE from(Integer key) {
            TRANSFER_ORDER_ENTRY_TYPE[] values = TRANSFER_ORDER_ENTRY_TYPE.values();
            for (TRANSFER_ORDER_ENTRY_TYPE deliveryType : values) {
                if (deliveryType.getCode().equals(key)) {
                    return deliveryType;
                }
            }
            return TRANSFER_ORDER_ENTRY_TYPE.ALIPAY;
        }
    }

}
